package com.gs.spring.core.lifecycle;

import java.util.Date;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Required;

public class SimpleBean {
	private String simpleMessage;
	private SimpleDependency simpleDependency;
	private AnotherSimpleBean anotherSimpleBean;
	public String getSimpleMessage() {
		return simpleMessage;
	}
	public void setSimpleMessage(String simpleMessage) {
		System.out.println(simpleMessage + " being set.");
		System.out.println(this.getClass().getName() + " : " + simpleMessage + " being set." + new Date());
		this.simpleMessage = simpleMessage;
	}
	public SimpleBean() {
		//System.out.print("*********************************");
		System.out.println(this.getClass().getName() + " :  being contructed..."+ new Date());
	}
	public SimpleDependency getSimpleDependency() {
		return simpleDependency;
	}
	@Required
	public void setSimpleDependency(SimpleDependency simpleDependency) {
		//System.out.print("*********************************");
		System.out.println(this.getClass().getName() + " : @Required Dependency being fulfilled..."+ new Date());
		this.simpleDependency = simpleDependency;
	}
	public AnotherSimpleBean getAnotherSimpleBean() {
		return anotherSimpleBean;
	}
	@Autowired
	public void setAnotherSimpleBean(AnotherSimpleBean anotherSimpleBean) {
		//System.out.print("*********************************");
		System.out.println(this.getClass().getName() + " : @Autowired Dependency being fulfilled..."+ new Date());
		this.anotherSimpleBean = anotherSimpleBean;
	}
	
}
